package com.shan.mybatis.exception;

import com.shan.mybatis.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: ShanYuQing
 * @Version: v1.0
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public Result result(Exception e){
        e.printStackTrace();
        return Result.error("对不起，操作失败，去联系管理员");
    }
}
